# -*- coding:utf-8 -*-
# Author:Ami
# @Time    : 2018/11/3 11:05
money = int(input("请输入你的工资:"))
goods = [[ "iphone", 8000], [ "ipad", 5000], [ "日本7日游", 20000]]
goodsLst = []
let = "111"
print(let.isdigit())

# for i in goods:
#     print(goods.index(i),i)
for index,i in enumerate(goods):
    print(index,i)
while money > 0:
    oGoods = input("请输入编号购买：")
    if oGoods == 'q':
        break

    elif type(int(oGoods)) == int:
        num = int(oGoods)
        if money - goods[num - 1][2] >= 0:
            money = money - goods[num - 1][2]
            goodsLst.append(goods[num - 1][1])
            print("还剩", money)
        else:
            print("兄die，钱不够啊")

print("你购买了", goodsLst, "还剩", money)
